import {Component, OnInit} from '@angular/core';
import {S1Service} from '../../service/s1.service';
@Component({
  selector: 'app-b',
  templateUrl: './b.component.html',
  styleUrls: ['./b.component.css']
})
export class BComponent implements OnInit {
  data: string = '';
  constructor(public s: S1Service) {
  }
  ngOnInit() {
    this.s.currentSend.subscribe(res => {
      this.data = res;
    });
  }
}
